package com.ruoyi.project.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.SysRecordMapper;
import com.ruoyi.project.system.domain.SysRecord;
import com.ruoyi.project.system.service.ISysRecordService;

/**
 * 出入库Service业务层处理
 *
 * @author orange
 * @date 2022-04-07
 */
@Service
public class SysRecordServiceImpl implements ISysRecordService
{
    @Autowired
    private SysRecordMapper sysRecordMapper;

    /**
     * 查询出入库
     *
     * @param recordId 出入库主键
     * @return 出入库
     */
    @Override
    public SysRecord selectSysRecordByRecordId(Long recordId)
    {
        return sysRecordMapper.selectSysRecordByRecordId(recordId);
    }

    /**
     * 查询出入库列表
     *
     * @param sysRecord 出入库
     * @return 出入库
     */
    @Override
    public List<SysRecord> selectSysRecordList(SysRecord sysRecord)
    {
        return sysRecordMapper.selectSysRecordList(sysRecord);
    }

    /**
     * 新增出入库
     *
     * @param sysRecord 出入库
     * @return 结果
     */
    @Override
    public int insertSysRecord(SysRecord sysRecord)
    {
        sysRecord.setCreateTime(DateUtils.getNowDate());
        return sysRecordMapper.insertSysRecord(sysRecord);
    }

    /**
     * 修改出入库
     *
     * @param sysRecord 出入库
     * @return 结果
     */
    @Override
    public int updateSysRecord(SysRecord sysRecord)
    {
        return sysRecordMapper.updateSysRecord(sysRecord);
    }

    /**
     * 批量删除出入库
     *
     * @param recordIds 需要删除的出入库主键
     * @return 结果
     */
    @Override
    public int deleteSysRecordByRecordIds(Long[] recordIds)
    {
        return sysRecordMapper.deleteSysRecordByRecordIds(recordIds);
    }

    /**
     * 删除出入库信息
     *
     * @param recordId 出入库主键
     * @return 结果
     */
    @Override
    public int deleteSysRecordByRecordId(Long recordId)
    {
        return sysRecordMapper.deleteSysRecordByRecordId(recordId);
    }
}
